import { ALL_CATEGORY_ITEM } from '@/constants'

export default {
  namespaced: true,
  state: () => ({
    currentCategory: ALL_CATEGORY_ITEM,
    // 搜索文本
    searchText: '',
    routerType: 'none'
  }),
  mutations: {
    changeCurrentCategory(state, newCategory) {
      state.currentCategory = newCategory
    },
    changeSearchText(state, newSearchText) {
      state.searchText = newSearchText
    },
    changeRouterType(state, newType) {
      state.routerType = newType
      console.log('跳转类型:', state.routerType)
    }
  }
}
